//
//  HNSH_GoodsSpecTitleHeader.m
//  HNSH_SingleProject
//
//  Created by 李宇廷 on 2023/2/25.
//

#import "HNSH_GoodsSpecTitleHeader.h"

@interface HNSH_GoodsSpecTitleHeader ()
/** 标题 */
@property (nonatomic, strong)UILabel * titleLabel;
@end

@implementation HNSH_GoodsSpecTitleHeader

//MARK: Cycle Methods
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self addAllViews];
        [self addAllLayout];
    }
    return self;
}

- (void)addAllViews{
    [self addSubview:self.titleLabel];
}

- (void)addAllLayout{
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.right.mas_equalTo(-20);
        make.top.height.mas_equalTo(self);
    }];
}

//MARK: Setter Methods
- (void)setTitle:(NSString *)title{
    _title = title;
    
    self.titleLabel.text = title;
}

//MARK: Getter Methods
- (UILabel *)titleLabel{
    if (!_titleLabel) {
        _titleLabel = [UILabel new];
        _titleLabel.textColor = [UIColor appBlack333LabelColor];
        _titleLabel.font = [UIFont systemFontOfSize:14];
    }
    return _titleLabel;
}
@end
